<?php

//通用的方法
function echoByAuthority($uri, $html) {
    static $uris = array();
    if (!isset($uris[$uri])) {
        $business = \Business\Admin\AdminModel::getInstance();
        $admin    = $business->validateLogin();
        if ($business->hasPrivilegeByUri($admin["admin_id"], $uri)) {
            $uris[$uri] = 1;
        } else {
            $uris[$uri] = 0;
        }
    }

    if ($uris[$uri] == 1) {
        echo $html;
    }
}
